package collectionexercise;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public class ArrayToList {
    public static void main(String[] args) {
        Integer [] array = {1,3,6,8,5,9,46,3,34};
        List<Integer> list = Arrays.asList(array);
        System.out.println(list);
        for (Integer  s: list
             ) {
            System.out.println(s);
        }

        Iterator<Integer> it = list.iterator();

        while (it.hasNext()){
            Integer a = it.next();
            System.out.println(a);
            if(a.equals("3")){
                System.out.println("移除");
            }
        }
        System.out.println(list);
    }

}
